// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	11/13/2013 11:09:01 AM				
// -----------------------------

#ifndef _Sound_h
#define _Sound_h

#include "Common.h"

class AudioManager;
class SoundChannel;

class Sound
{
public:
	friend class AudioManager;
	friend class SoundChannel;

	~Sound();

	SoundChannel*	Play(bool bLoop = false, float fVolume = 1.0f);
	void			Pause();
	void			Stop();

	void			SkipForward(float fTimeSkip);
	void			SkipBackwards(float fTimeSkip);

	void			SetPosition(UINT uPosition);
	void			SetVolume(float Volume);

	UINT			GetLength() const;
	UINT			GetPosition() const;

	bool			IsPlaying() const;
	SoundChannel*	GetSoundChannel() const;

private:

	Sound(FMOD::Sound* lpSound, AudioManager* lpAudioManager);

	FMOD::Sound*	m_lpSound;
	AudioManager*	m_lpAudioManager;
	SoundChannel*	m_lpSoundChannel;
	bool			m_bPaused;

	Sound(const Sound& refSound);
	Sound& operator=(const Sound& refSound);
};

#endif